﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TomVanGaever.BCS.Parser
{
    public partial class BCSParserCheckControl : BCSUserControl
    {
        private IEnumerable<BCSUserControl> m_controls;

        public BCSParserCheckControl(List<BCSUserControl> list)
        {
            m_controls = list;
            InitializeComponent();
        }

        public string Overview {
            get { return txtlog.Text; }
            set { txtlog.Text=value; }
        }

		public override string TitleText { 
			get { 
				label2.Visible = false;
				return label2.Text;
			} 
		} 

        public Button BtnFinish
        {
            get { return btnFinish; }
            set { btnFinish = value; }
        }

        public override string GetStatusString()
        {
            return this.ToString();
        }

        public override bool StatusEnabled
        {
            get
            {
                return false;
            }
        }

        public void LoadControls()
        {
            StringBuilder sb = new StringBuilder();
            foreach (BCSUserControl c in m_controls.Where(c=>c.StatusEnabled)) {
                sb.Append(c.GetStatusString());
                sb.Append(Environment.NewLine);
                sb.Append(Environment.NewLine);
            }
            txtlog.Text = sb.ToString();
        }

        private void BCSParserCheckControl_Load(object sender, EventArgs e)
        {
            this.LoadControls();
        }

    }
}
